import request from '@/utils/request'

// 查询漏水预警报警日志列表
export function getWaterLeakageLogs(query) {
  return request({
    url: '/waterleakage/transmitter/logs',
    method: 'get',
    params: query
  })
}

// 查询漏水监控设备管理列表
export function getWaterLeakageDeviceList(query) {
  return request({
    url: '/waterleakage/device/manage',
    method: 'get',
    params: query
  })
}

// 控制漏水监控设备
export function controlWaterLeakageDevice(data) {
  return request({
    url: '/waterleakage/device/control',
    method: 'post',
    data: data
  })
}

// 清空漏水预警报警日志
export function clearWaterLeakageLogs() {
  return request({
    url: '/waterleakage/device/logs/clear',
    method: 'delete'
  })
}

// 获取漏水监控设备参数设置
export function getWaterLeakageParameters() {
  return request({
    url: '/waterleakage/device/parameters',
    method: 'get'
  })
}

// 保存漏水监控设备参数设置
export function saveWaterLeakageParameters(data) {
  return request({
    url: '/waterleakage/device/parameters',
    method: 'post',
    data: data
  })
}

// 获取漏水监控设备状态
export function getWaterLeakageDeviceStatus(deviceId) {
  return request({
    url: '/waterleakage/device/status/' + deviceId,
    method: 'get'
  })
}

// 更新设备工作模式
export function updateDeviceWorkMode(data) {
  return request({
    url: '/waterleakage/device/workmode',
    method: 'post',
    data: data
  })
}